home *** CD-ROM | disk | FTP | other *** search
- Path: haapa.oulu.fi!not-for-mail
- From: tikarjal@haapa.oulu.fi (Timo Karjalainen)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Q: Finding ASL Window ptr
- Date: 6 Apr 1996 14:02:13 GMT
- Organization: University of Oulu
- Message-ID: <4k5th5$4tt@ousrvr3.oulu.fi>
- NNTP-Posting-Host: haapa.oulu.fi
- Mime-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: 8bit
- Summary: How to find the Window address of an open ASL req?
- Keywords: ASL, Window, IDCMP, stupid trick with the OS
- X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
-
- Some time ago I wondered how to get an ASL requester closed
- without user intervention. One proposed solution was to send
- the ASL requester window a fake IntuiMessage IDCMP_CLOSEWINDOW.
-
- Now: How do I find this Window, and thus its UserPort? I'll need
- that in order to put a Message there. :-D
-
- It would be most convenient if the ASL structure had a field in
- it that would contain the address of the Window. This is, however,
- not the case. (Well, its really ASL private information, but hey, I
- *need* to get that thing closed somehow!)
-
- My program runs on a private screen. I know the addresses of all
- open windows that are my own. Do I just have to step through the screen's
- Window list and send a faked IDCMP_CLOSEWINDOW to all windows whose
- address I do not have in the list of "known windows"? Is this even
- legal? struct Screen has a documented Window ptr and struct Window has
- a documented next Window ptr.
-
- Hey, Amiga Tech, if you're reading this: I hope you'll fix the VERY BROKEN
- ASL feature of IntuiMessage callbacks. For a program to do one-task
- multiwindowing with more than one window handling user input at a time,
- it really needs to do asynchronous ASL requesters! However, AslRequest()
- only returns after the user is finished with the requester. If the only
- way to process user input while in AslRequest() is to use the shared IDCMP
- & callback feature, there must be a way to close an open ASL requester!
- I really suggest you add to asl.library a function CloseAslRequest(), which
- would take the address of an ASL requester structure and close the requester,
- if it was open.
-
- A better solution would be an AsynchAslRequest(). It would open and set
- up the requester window and *return immediately*. Once the program notices
- an IDCMP message that is for an ASL requester, it would pass the message
- to an asl.library function that would process it. This function would return
- NULL if the IDCMP event didn't lead to closing the requester, otherwise
- it would return the address of the ASL requester structure.
-
- In fact it would be best to have a CloseAslRequest() as well, and also
- something to ReopenAslRequest(). Sometimes a program needs to close the
- ASL requester while it for example closes the screen and reopens it in
- another display mode. Reopening would bring the requester back just like
- it was never closed, except that it would take into account possible
- changes in the screen, like another font and adjusting requester size
- or position if the screen has become smaller.
-
- Additions like these are *necessary* for Amiga applications to be
- consistently what Amiga is best known for: multitasking. With these
- things done, Amiga applications could maintain full "internal multitasking"
- capabilities and intuitiveness. Didn't the Style Guide say that quitting
- a program should be possible at all times and that the user should be
- given all power to do anything?áWell, ASL makes those things impossible.
-
- I think I'm not the only one who *just hates* file or other requesters that
- disable them from doing anything else. Sometimes you *need* to able to do
- something else while the requester is open. Once you can do a little
- something, you'd expect you can do *anything* - also things like quitting
- the program or changing (closing!) the screen on which the requester has
- been opened. It's a matter of user-friendliness. It isn't very fun to chase
- down every single requester window on a crowded screen.
-
- tikarjal
-
-
-